import { Router } from 'express';
import { authenticate } from '@/middleware/auth';
import {
  register,
  login,
  getProfile,
  updateProfile,
  changePassword,
  deleteUser,
  setDefaultVehicle,
  getDefaultVehicle,
} from '@/controllers/userController';

const router = Router();

// 公开路由
router.post('/register', register);
router.post('/login', login);

// 需要认证的路由
router.get('/profile', authenticate, getProfile);
router.put('/profile', authenticate, updateProfile);
router.put('/change-password', authenticate, changePassword);
router.delete('/delete', authenticate, deleteUser);
router.put('/set-default-vehicle', authenticate, setDefaultVehicle);
router.get('/get-default-vehicle', authenticate, getDefaultVehicle);

export default router;
